
//#include "CSharpGarbagePointer.h"

#include "Encoding.h"
#include "UTF8Encoding.h"

using namespace Riccsson::System::Text;

// Create global Encoding objects.
GC_PTR<Encoding> Encoding::encoding_ASCII( nullptr );
GC_PTR<Encoding> Encoding::encoding_BigEndianUnicode( nullptr );
GC_PTR<Encoding> Encoding::encoding_Default( nullptr );
GC_PTR<Encoding> Encoding::encoding_Unicode( nullptr );
GC_PTR<Encoding> Encoding::encoding_UTF32( nullptr );
GC_PTR<Encoding> Encoding::encoding_UTF7( nullptr );
GC_PTR<Encoding> Encoding::encoding_utf8( nullptr );

PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, ASCII)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, BigEndianUnicode)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, Default)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, Unicode)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, UTF32)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, UTF7)
{
	throw;
}
PROP3_GET_CPP(Encoding, GC_PTR<Encoding>, UTF8)
{
	if(encoding_utf8 == null)
	{
		encoding_utf8 = GC_PTR<Encoding>( (UTF8Encoding*)new UTF8Encoding() );
	}

	return encoding_utf8;
}

// Initialize all static C# properties.
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, ASCII)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, BigEndianUnicode)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, Default)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, Unicode)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, UTF32)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, UTF7)
PROP3_STATIC_INIT(Encoding, GC_PTR<Encoding>, UTF8)